#pragma once




#include <unordered_map>
#include "Color.h"
#include "Plotter.h"
#include "Point2D.h"
#include "Lighter.h"

namespace HW2
{
	struct Coordinates;
	struct Polygon; 

	struct InterpolationData
	{
		InterpolationData(int x = 0, double z = 0, Coordinates beforeProjection = Coordinates(), Coordinates orig = Coordinates()) {
			leftX = rightX = x;
			leftZ = rightZ = z;
			leftCoor = rightCoor = beforeProjection;
			leftOrig = rightOrig = orig;
		}

		int leftX, rightX;
		double leftZ, rightZ;
		Coordinates leftCoor, rightCoor, leftOrig, rightOrig;
	};

	struct PolygonData //: public Plotter
	{
		// y -> left+right
		std::unordered_map<int, InterpolationData> data;

		Polygon &p;
		
		PolygonData(Polygon &p);
		
		void plot(int x, int y, double z, Color c, Coordinates orig);
		void plot(int x, int y, double z, Color c, Coordinates beforeTransformation, Coordinates original);
		void draw(Plotter &p);
	};
}
